#ifndef UNDOPROCESS_H
#define UNDOPROCESS_H

#include "LogicProcess.h"
#include "DeleteProcess.h"
#include "AddProcess.h"
class UndoProcess:public LogicProcess{
protected:
	
	int times;
	void RestoreCommand(CommandPackage Package);
	bool canRestore();
	CommandStack *needCommandStack;
	CommandPackage getNearestPackage();

	void backUpToRedo(CommandPackage currentPackage);
	void pushToRedoList(Task task, commandType type, taskContainer container,bool needMore);
	CommandPackage convertToRedoPackage(CommandPackage currentPackage);
	commandType convertCommand(commandType type);
public:
	UndoProcess(string cmdString,allTaskList *givenLists,allCommandStack *givenStacks,int time);
	void HandleProcesss();
	void RestoreByCommandType(Task task,commandType cmdType,taskContainer rightList);
	void quickProcess(Task task){}
	TaskList *getNeedList(taskContainer container);
};
#endif